package service.info;

import mapper.info.InfoMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pojo.Info;

import javax.annotation.Resource;
import java.util.List;
@Transactional
@Service("infoService")
public class InfoServiceImpl implements InfoService{
    @Resource
    private InfoMapper infoMapper;
    //后台
    public Info getHuiXian(int id) {
        return infoMapper.getHuiXian(id);
    }

    public List<Info> getAppInfoList(Integer pageIndex,Integer pageSize,String softwareName, String flatformId, String categoryLevel1, String categoryLevel2, String categoryLevel3) {
        List<Info> appInfoList = infoMapper.getAppInfoList(pageIndex,pageSize,softwareName, flatformId, categoryLevel1, categoryLevel2, categoryLevel3);
        return appInfoList;
    }
    public int count(String softwareName, String flatformId, String categoryLevel1, String categoryLevel2, String categoryLevel3) {
        return infoMapper.count(softwareName,flatformId,categoryLevel1,categoryLevel2,categoryLevel3);
    }

    public int updateStatusTrue(int id) {
        return infoMapper.updateStatusTrue(id);
    }

    public int updateStatusFalse(int id) {
        return infoMapper.updateStatusFalse(id);
    }

    //开发者
    public int userKaicount(String softwareName, String flatformId, String categoryLevel1, String categoryLevel2, String categoryLevel3, String status) {
        return infoMapper.userKaicount(softwareName,flatformId,categoryLevel1,categoryLevel2,categoryLevel3,status);
    }

    public List<Info>getuserKaiAppInfoList(Integer pageIndex, Integer pageSize, String softwareName, String flatformId, String categoryLevel1, String categoryLevel2, String categoryLevel3, String status,int id) {
        List<Info> userKaiInfoList=infoMapper.getuserKaiAppInfoList(pageIndex,pageSize,softwareName,flatformId,categoryLevel1,categoryLevel2,categoryLevel3,status,id);
        return userKaiInfoList;
    }

    public int addAppInfoList(Info info) {
        return infoMapper.addAppInfoList(info);
    }

    public Info getAppInfohuiXian(int id) {
        return infoMapper.getAppInfohuiXian(id);
    }

    public int updateAppInfoList(Info info) {
        return infoMapper.updateAppInfoList(info);
    }

    public Info APKchongMing(String APKName) {
        return infoMapper.APKchongMing(APKName);
    }

    public Info softwareNamechongMing(String softwareName) {
        return infoMapper.softwareNamechongMing(softwareName);
    }

    public int delByVersionAppId(int id) {
        return infoMapper.delByVersionAppId(id);
    }

    public int delByInfoId(int id) {
        return infoMapper.delByInfoId(id);
    }

    public int updateStatusshang(int id) {
        return infoMapper.updateStatusshang(id);
    }

    public int updateStatusxia(int id) {
        return infoMapper.updateStatusxia(id);
    }

    public int updateStatuszTai(int id) {
        return infoMapper.updateStatuszTai(id);
    }
}
